<template>
	<view class="app-container">
		<view class="remark">
			<textarea v-model="remark" placeholder="备注..." />
		</view>
		<button type="primary" @click="handleSubmit">提交申请</button>
	</view>
</template>

<script>
	import {
		getUser
	} from '../../utils/auth.js'
	export default {
		data() {
			return {
				toId: '',
				fromId: '',
				remark:''
			}
		},
		onLoad(options) {
			this.toId = options.toId
			this.fromId = getUser().userInfo.userId
		},
		methods: {
			handleSubmit() {
				let jsonData = {
					toId:this.toId,
					fromId:this.fromId,
					remark:this.remark
				}
				this.$http('/admin/chat/friendApply/save','POST',jsonData).then(res =>{
					uni.showToast({
						title:'提交好友申请成功'
					})
					setTimeout(()=>{
						uni.navigateBack()
					},500)
				})
			}
		}
	}
</script>

<style>
	.remark{
		background-color: #fff;
		height: 50px;
		display: flex;
		padding: 5px 20px;
		margin-bottom: 20px;
	}

</style>
